package cate.common.table.item.fairy.sheet;

import cate.common.table.ESheet;
import cate.common.table.item.fairy.row.FairyBaseRow;

import java.util.List;
import java.util.stream.Collectors;

/** 仙器基础 */
public class FairyBaseSheet extends ESheet<FairyBaseRow> {

    @Override
    public String getSheetName() {
        return "灵器基础";
    }

    @Override
    protected FairyBaseRow buildRow() {
        return new FairyBaseRow();
    }

    public FairyBaseRow getRow(int protoId, int level) {
        return getList().stream().filter(e -> e.protoId == protoId && e.level == level).findAny().orElse(null);
    }

    public List<FairyBaseRow> getLevelLowerRows(int protoId, int level) {
        return getList().stream().filter(e -> e.protoId == protoId && e.level <= level).collect(Collectors.toList());
    }
}
